<?php
  require 'dbcon.php';
   $ename=$_REQUEST['e_name'];
   $e_img=$_REQUEST['e_img'];
   $date_of_birth=$_REQUEST['date_of_birth'];
   $date_of_entry=$_REQUEST['date_of_entry'];
   $edept=$_REQUEST['e_demp'];
   $password=$_REQUEST['password'];
   $sql="insert into tb_emp(e_name,e_img,date_of_birth,date_of_entry,e_dept,password) values('{$ename}','{$e_img}','{$date_of_birth}','{$date_of_entry}','{$edept}','{$password}')";
   $rs=$db->query($sql);//执行SQL语句
    if  ($rs==true)
    {
       echo "<script language='javascript' type='text/javascript'>"; 
       //echo "alert('留言成功！');";
       echo "window.location.href='index.php';";
       echo "</script>";
    }
    else {
       echo "<script language='javascript' type='text/javascript'>"; 
       echo "alert('添加员工失败！');";
       echo "window.location.href='index.php';";
       echo "</script>";
   }


